package com.mybatis;

import java.util.Scanner;

public class Main {
        public static void main(String... args){
            while(true){


            Scanner in = new Scanner(System.in);
            Integer  integer =Integer.valueOf(in.nextLine());


            Scanner inS = new Scanner(System.in);
            String  inStrs=(String)inS.nextLine();
            String[]  integerArrs = inStrs.split(" ");
            for(int i=0;i<integer-1;i++){

                for(int j=i+1;j<integer;j++){
                    Integer a = Integer.valueOf(integerArrs[i]+integerArrs[j]);
                    Integer b = Integer.valueOf(integerArrs[j]+integerArrs[i]);

                    if(a<b){
                        String tmp = integerArrs[i];
                        integerArrs[i] = integerArrs[j];
                        integerArrs[j]=tmp;
                    }
                }

            }
                int length = integerArrs.length;
                StringBuilder sb = new StringBuilder(length);
                for (int i = 0; i < length; i++) {
                    sb.append(integerArrs[i]);
                }

            System.err.println(sb.toString());
            }
        }
}
